﻿@{
    ViewBag.Title = "My Closed Requests";
}

@model List<DiaosFix.Core.Requests>

<h2>My Closed Requests</h2>

@if (!(ViewBag.ErrorMessage as string).IsEmpty())
{
    <p>Sorry, shit happens: @ViewBag.ErrorMessage</p>
}
else
{
    if (Model.Count == 0)
    {
        <p>You don't have any closed requests yet~</p>
    }
    else
    {
        foreach (var item in Model.OrderByDescending(p => p.OpenDate))
        {
            <fieldset>
                <legend>Request ID: @item.Id - @item.RequestArea.AreaName</legend>
                <div class="request-item">
                    <p>Opened At: @item.OpenDate, Assigned To: @item.AssignedToUser.Username (@item.AssignedToUser.RealName)</p>
                    <p>@item.RequestDescription</p>
                </div>
                <div>
                    Remarks: @item.Remarks
                </div>
            </fieldset>
        }
    }
}